package manejadorimagen;

import java.awt.Color;
import java.awt.Graphics;
import java.awt.image.BufferedImage;
import javax.swing.BorderFactory;
import javax.swing.JPanel;

public class panelDibujo extends JPanel {

    private BufferedImage imagen;
    
    public panelDibujo(BufferedImage img) {
        this.imagen=img;
        this.setBounds(0,0,this.imagen.getWidth(),this.imagen.getHeight());
        this.setBorder(BorderFactory.createLineBorder(Color.black));
        this.setVisible(true);
    }

    public void paintComponent(Graphics g) {
        super.paintComponent(g);       
        g.drawImage(this.imagen,0,0,this);
    }  
}